package com.testmanager.testmananger.quantitative.constants;

import com.testmanager.testmananger.foundation.domain.enums.EnumBase;

import java.util.Arrays;

public enum IteraSearchStatus implements EnumBase {
    WAITREVIEW("待评审",5),
    WAITDEVELOPER("待开发",4),
    DEVELOPING("开发中",3),
    WAITTESTER("待测试",2),
    TESTING("测试中",1),
    WAITONLINE("待上线",0),

    COMPLETE("归档（已上线）",6),
    WAITING("挂起",7),
    OBSOLETE("作废",8),
    ALL("所有",9),
    UNComplete("未完成",10)
    ;
    public static final String CODE = "interation_serach_status";
    private final String name;
    private final Integer value;

    IteraSearchStatus(String name, Integer value) {
        this.name = name;
        this.value = value;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public Integer getValue() {
        return value;
    }

    public static IteraSearchStatus getValueOf(Integer value){

        return Arrays.stream(IteraSearchStatus.values())
                .filter(t->t.getValue().equals(value))
                .findFirst()
                .orElse(IteraSearchStatus.ALL);
    }

    public static void main(String[] args) {
        IteraSearchStatus.getValueOf(1);
       // BugStatus.getValueOf(1);
    }



}
